<?php
namespace app\common\validate\member;
use think\Validate;
/**
 * 用户身份证信息验证器
 */
class MemberIdCardValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'ids' => ['require', 'array'],
        'id' => 'require',
        'is_disable' => ['require', 'in' => '0,1'],
        'name' => 'require',
        'num' => 'require',
        'address' => 'require',
        'auth_status' => ['require', 'in' => '1,2,3'],
    ];
    // 错误信息
    protected $message = [
        'name.require' => '请填写姓名',
        'num.require' => '请填写身份证号',
        'address.require' => '请填写住址',
        'auth_status.require' => '请选择审核状态',
    ];
    // 验证场景
    protected $scene = [
        'info'    =>  ['id'],
        'add'     =>  [],
        'edit'    =>  ['member_id','name','num','address'],
        'dele'    =>  ['ids'],
        'disable' =>  ['ids', 'is_disable'],
        'auth' =>  ['ids', 'auth_status'],
    ];
}
